#ifndef GL_WIDGET_H
#define GL_WIDGET_H

#include <QOpenGLWidget>
#include <QOpenGLFunctions>
#include <QElapsedTimer>
#include <QTimer>
#include "particle_shader_program.h"
#include "particle_system.h"
#include "particle_shooter.h"
#include "particle_drawer.h"

class GLWidget : public QOpenGLWidget, protected QOpenGLFunctions {

        Q_OBJECT

    public:
        GLWidget(QWidget *parent = nullptr);
        ~GLWidget();

    protected:
        void initializeGL() override;
        void resizeGL(int w, int h) override;
        void paintGL() override;

    private slots:
        void animate();

    private:
        ParticleShaderProgram *m_particleShaderProgram = nullptr;
        ParticleSystem *m_particleSystem = nullptr;
        ParticleDrawer *m_particleDrawer = nullptr;
        ParticleShooter *m_redShooter = nullptr;
        ParticleShooter *m_greenShooter = nullptr;
        ParticleShooter *m_blueShooter = nullptr;

        QElapsedTimer m_elapsedTimer;
        QTimer m_timer;
};
#endif // GL_WIDGET_H
